//******************************************************************
//
// Copyright 2017 Samsung Electronics All Rights Reserved.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#ifndef INCLUDE_TESTCASE_CHP_GTEST_CHPHELPER_H_
#define INCLUDE_TESTCASE_CHP_GTEST_CHPHELPER_H_

#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include "CoapHttpHandler.h"

#include "uarraylist.h"
#include "CoapHttpParser.h"
#include "CoapHttpMap.h"
#include "cJSON.h"

#include "CommonUtil.h"
#include "CommonTestUtil.h"

#include "OCPlatform.h"
#include "OCApi.h"

#include "IotivityTest_Logger.h"

#define CHP_SLEEPTIME_MAX   5

using namespace OC;

class CHPHelper
{
        static CHPHelper *s_pchpHelper;

        int m_secureFlag;
        int m_nonsecureFlag;

    public:
        CHPHelper(void);
        ~CHPHelper(void);
        static CHPHelper *getInstance(void);
        OCStackResult initializeOC();
        OCStackResult stopOC();
        OCStackResult initializeCHPNonSecure();
        OCStackResult initializeCHPSecure();
        OCStackResult terminateCHP();
        bool isInitializedCHP();

};

#endif
